﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Data_Access_Layer;
using System.Data;

namespace Business_Logic_Layer
{
    public class BusinessLogic
    {
        //Create 1 object of Data Access Layer, must using namespace Data_Access_Layer to use class DataAccess
        DataAccess da = new DataAccess();
        //Insert into table SinhVien
        public void Insert(string masv, string tensv)
        {
            string sql = "insert into sinhvien values('" + masv + "','" + tensv + "')";
            da.ExcuteNonQuery(sql);
        }
        //Delete a Column 
        public void Delete(string masv)
        {
            string sql = "delete from sinhvien where masv='"+masv+"'";
            da.ExcuteNonQuery(sql);
        }
        //Update data
        public void Update(string masv, string tensv)
        {
            string sql = "update sinhvien set tensv='"+tensv+"' where masv='"+masv+"'";
            da.ExcuteNonQuery(sql);
        }
        //Show table
        public DataTable ShowData()
        {
            string sql = "select * from sinhvien";
            return da.GetTable(sql);
        }

    }
}
